#include <iostream>
using namespace std;
class A
{
public:
	 virtual void func(int val = 2)
	{
		cout << "A->" << endl;
	}
	 virtual void test()
	{
		func();
	}
};
class B : public A
{
public:
	 virtual void func(int val = 3)
	{
		cout << "B->" << val<< endl;
	}
	virtual void test()
	{
		func();
	}
};
int main()
{
	B* p = new B;
	p->test();
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
	return 0;
}
